<include file="Public:header" />
<div class="container">
  <div class="mainbody"> <include file="Public:mallmenu" />
    <div class="rig_lm03">
      <div class="title" ><img src="{$Think.config.static_path}images/listicon.jpg" class="icon" >
        <h2>创建/编辑城市</h2>
      </div>
      <div class="detail-tab">
        <form name="form1"  enctype="multipart/form-data" method="post" action="__URL__/savecity" role="form" >
          <div class="form-group">
            <label for="title">名称<i>*</i></label>
            <input type="text" name="title" class="searcheTxt"  id="title" placeholder="" value="{$data.title}">
          </div>
          <div class="form-group">
            <label for="p_stint">电话<i>*</i></label>
            <input type="text" name="tel" class="searcheTxt"  id="title" placeholder="" value="{$data.tel}">
          </div>
          <div class="form-group">
            <label for="p_stint">地址<i>*</i></label>
            <input type="text" name="address" class="searcheTxt"  id="title" placeholder="" value="{$data.address}">
          </div>
          
          <div class="form-group ">
            <label for="IbtnEnter"></label>
            <button type="button"  id="IbtnEnter" class="btn btn-primary "><span class="glyphicon glyphicon-floppy-saved"></span> 保 存 </button>
          </div>
          <input type="hidden" name="id" value="{$data.id}">
        </form>
      </div>
    </div>
  </div>
</div>
<include file="Public:footer" /> 
<script type="text/javascript">

$(function(){
	$('#addcity').addClass('rig_seleli');
	$("#IbtnEnter").click(function(){
		   saveActivity();
	 });
});

function saveActivity() {
    var state = true;
    if ($("#title").attr("value") == "") {
        alert("请输入活动标题！");
        state = false;
        $("#title").focus();
        return false
    }
	if ($("#start_time").attr("value") == "") {
        alert("请输入开始时间！");
        state = false;
        $("#start_time").focus();
        return false
    }
	if ($("#end_time").attr("value") == "") {
        alert("请输入结束时间！");
        state = false;
        $("#end_time").focus();
        return false
    }
    
    if (state) {
       $("form").submit();
		//commonAjaxSubmit("__URL__/saveAddAvtivity","{$_REQUEST['id']}");
    }
};
</script>